@extends('user.base.index')

@section('content')
    <div class="block-area" id="text-input">
                <h3 class="block-title">修改</h3>
                 <form class="row form-columned" action="/admin/product/{{$id}}" role="form" enctype='multipart/form-data' method="post">
                    @foreach($product as $v)
                        <input type="hidden" name="_token" value="{{ csrf_token()}}">
                        <input type="hidden" name="_method" value="PUT">
                        <div class="col-md-4">
                           书名：<input type="text" name="name"class="form-control input-sm m-b-10" value="{{$v->name}}">
                        </div>
                        <div class="col-md-4">
                           关键字：<input type="text" name="keywords" class="form-control input-sm m-b-10" value="{{$v->keywords}}">
                        </div>
                        <div class="col-md-4 m-b-10">
                          
                              类别：<select name="path_id">
                              
                                @foreach($type as $t)
                                
                                <option value="{{$t->id}}">{{$t->name}}</option>
                                @endforeach
                            </select>
                        </div>
                        <div class="clearfix"></div>
                        <div class="col-md-4">
                            小图：<input type="file" name="picture"class="form-control input-sm m-b-10" >
                           
                        </div>
                        <div class="col-md-4">
                            大图：<input type="file" name="big_picture" class="form-control input-sm m-b-10" >
                            
                        </div>
                        <div class="col-md-4">
                            原价：<input type="text" name="fixed_price" class="form-control input-sm m-b-10" value="{{$v->fixed_price}}">
                        </div>
                        <div class="col-md-4">
                            当当价：<input type="text" name="lower_price" class="form-control input-sm m-b-10" value="{{$v->lower_price}}">
                        </div>
                        
                        <div class="col-md-12">
                            描述：<textarea class="form-control m-b-10" name="description" rows="10" >{{$v->description}}</textarea>
                        </div>
                        
                        <div class="col-md-10">
                            <button type="submit" class="btn btn-sm">确认修改</button>
                        </div>
                         @endforeach
                    </form>
                    @if (count($errors) > 0)
                        <div class="alert alert-danger">
                        <ul>
                            @foreach ($errors->all() as $error)
                                <p>{{ $error }}</p>
                            @endforeach
                        </ul>
                    </div>
                @endif
    </div>
@stop

